//
//  YHOptionTagsView.h
//  ScriptKill
//
//  Created by 林宁宁 on 2021/3/31.
//  Copyright © 2021 优智汇. All rights reserved.
//

#import "YHBaseView.h"
#import "YHBaseObject.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, YHOptionTagsStyle) {
    YHOptionTagsStyle_Border,
    YHOptionTagsStyle_FillColor,
};

@class YHOptionTagsConfig;
@interface YHOptionTagsView : YHBaseView

@property (retain, nonatomic, readonly) YHOptionTagsConfig * config;

@property (retain, nonatomic, readonly) NSArray <NSString *>* currentTags;
@property (copy, nonatomic) NSString * currentTagsDes;

+ (YHOptionTagsView *)config:(void(^ _Nullable)(YHOptionTagsConfig * passConfig))config;

- (CGFloat)contentHeight;

- (void)resetWithTags:(NSArray <NSString * >*)tags;

- (void)resetWithTagCount:(NSInteger)count
                titleBlock:(NSString *(^_Nullable)(NSInteger index))titleBlock
            colorBoxBlock:(UIColor *(^_Nullable)(NSInteger index))colorBoxBlock
               tagIDBlock:(NSString *(^_Nullable)(NSInteger index))tagIDBlock;

@end

@interface YHOptionTagsConfig : YHBaseObject

/// 默认线框
@property (assign, nonatomic) YHOptionTagsStyle showStyle;

/// 设置水平 就水平方向一条线布局 不换行
@property (assign, nonatomic) UICollectionViewScrollDirection scrollDirection;

@property (assign, nonatomic) CGFloat space;

@property (retain, nonatomic) UIColor * tagColor;

/// 视图自动展开 按照content的大小展开 不能滚动
@property (assign, nonatomic) BOOL isAutoExpand;
/// 内存大小变化
@property (copy, nonatomic) void(^contentChangeBlock)(CGSize contentSize);

/// 点击Tag之后
@property (copy, nonatomic) void(^clickTagBlock)(NSString * tag, NSString * tagID, NSInteger tagIndex);
/// 多选
@property (copy, nonatomic) void(^selectTagsBlock)(NSArray <NSString *> * passTags);
@property (retain, nonatomic) NSMutableArray <NSString *> * selectTags;

/// 是否支持长按删除
@property (assign, nonatomic) BOOL canLongpressToDelete;
@property (copy, nonatomic) void(^deleteTagBlock)(NSString * tag, NSString * tagID, NSInteger tagIndex);

/// 新增  有设置这个就有新增按钮
@property (copy, nonatomic) void(^addTagBlock)(NSString * tag);

/// 最多个数
@property (assign, nonatomic) NSInteger maxCount;

@end

NS_ASSUME_NONNULL_END
